﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PloobsEngine.Publishers;
using Microsoft.Xna.Framework;

namespace PloobsEngine.Components
{
    public abstract class BasicComponent : IComponent
    {
        #region IComponent Members
        

        public virtual void Initialize()
        {
            
        }

        public virtual void Update(Microsoft.Xna.Framework.GameTime gt)
        {
        }

        public virtual void PreDraw(Microsoft.Xna.Framework.GameTime gt, Matrix activeView, Matrix activeProjection)
        {            
        }

        public virtual void AfterDraw(Microsoft.Xna.Framework.GameTime gt, Matrix activeView, Matrix activeProjection)
        {
        }

        public virtual void LoadContent(EngineStuff engine)
        {
        }

        #endregion

        #region IReciever Members

        public abstract string getMyName();

        #endregion

        #region IEntity Members
        private int id;
        public int getId()
        {
            return id;
        }

        public void setId(int id)
        {
            this.id = id;
        }

        #endregion


        #region ISubject Members
        private ISubject _sub = new ConcreteSubject();
        public void Attach(IObserver obs)
        {
            _sub.Attach(obs);
        }

        public int ObserverNumber()
        {
            return _sub.ObserverNumber();
        }

        public void Dettach(IObserver obs)
        {
            _sub.Dettach(obs);
        }

        public void DettachAll()
        {
            _sub.DettachAll();
        }

        public void Notify(object obj)
        {
            _sub.Notify(obj);
        }

        #endregion


        #region IComponent Members


        public abstract ComponentType ComponentType
        {
            get;
        }

        #endregion

    }
        
}
